//
// Created by liushuai on 2021/1/2.
//

#include "sum_n.h"
void sum_n(int target,int begin,std::vector<int>& v){
    if(target == 0){
        for(auto i:v)
            std::cout<<i<<" ";
        std::cout<<"\n";
    }
    for(int i=begin;i<=target;i++){
        v.push_back(i);
        sum_n(target-i,i+1,v);
        v.pop_back();
    }
}